
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="demo.css">
    <script src="iconfont.js"></script>

    <style type="text/css">
        .icon {
          /* 通过设置 font-size 来改变图标大小 */
          width: 1em; height: 1em;
          /* 图标和文字相邻时，垂直对齐 */
          vertical-align: -0.15em;
          /* 通过设置 color 来改变 SVG 的颜色/fill */
          fill: currentColor;
          /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
             normalize.css 中也包含这行 */
          overflow: hidden;
        }

    </style>
</head>
<body>
    <div class="main markdown">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-icon"></use>
                    </svg>
                    <div class="name">美元</div>
                    <div class="fontclass">#hd-icon</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-dingwei"></use>
                    </svg>
                    <div class="name">定位</div>
                    <div class="fontclass">#hd-dingwei</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-xinglijicun"></use>
                    </svg>
                    <div class="name">行李寄存</div>
                    <div class="fontclass">#hd-xinglijicun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-zhongbiao"></use>
                    </svg>
                    <div class="name">钟表</div>
                    <div class="fontclass">#hd-zhongbiao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-iconfontwifi1"></use>
                    </svg>
                    <div class="name">wifi</div>
                    <div class="fontclass">#hd-iconfontwifi1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-momentmessage"></use>
                    </svg>
                    <div class="name">评论</div>
                    <div class="fontclass">#hd-momentmessage</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-pinglun1"></use>
                    </svg>
                    <div class="name">评 论</div>
                    <div class="fontclass">#hd-pinglun1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-shoucang"></use>
                    </svg>
                    <div class="name">收 藏</div>
                    <div class="fontclass">#hd-shoucang</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-24xiaoshireshui"></use>
                    </svg>
                    <div class="name">24小时热水</div>
                    <div class="fontclass">#hd-24xiaoshireshui</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-fangzi-copy"></use>
                    </svg>
                    <div class="name">房子</div>
                    <div class="fontclass">#hd-fangzi-copy</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-rili-copy"></use>
                    </svg>
                    <div class="name">日历</div>
                    <div class="fontclass">#hd-rili-copy</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-rili"></use>
                    </svg>
                    <div class="name">日历</div>
                    <div class="fontclass">#hd-rili</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-sousuo"></use>
                    </svg>
                    <div class="name">搜索</div>
                    <div class="fontclass">#hd-sousuo</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-dianping"></use>
                    </svg>
                    <div class="name">点评</div>
                    <div class="fontclass">#hd-dianping</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-yduishanchu"></use>
                    </svg>
                    <div class="name">YDUI-删除</div>
                    <div class="fontclass">#hd-yduishanchu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-chuifengji"></use>
                    </svg>
                    <div class="name">吹风机</div>
                    <div class="fontclass">#hd-chuifengji</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-mianfeixishuyongpin"></use>
                    </svg>
                    <div class="name">免费洗漱用品</div>
                    <div class="fontclass">#hd-mianfeixishuyongpin</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-keyuding"></use>
                    </svg>
                    <div class="name">可预订</div>
                    <div class="fontclass">#hd-keyuding</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-icon_smoke"></use>
                    </svg>
                    <div class="name">可吸烟</div>
                    <div class="fontclass">#hd-icon_smoke</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-xiyan"></use>
                    </svg>
                    <div class="name">吸烟</div>
                    <div class="fontclass">#hd-xiyan</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-huiyishi"></use>
                    </svg>
                    <div class="name">会议室</div>
                    <div class="fontclass">#hd-huiyishi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-shizhong"></use>
                    </svg>
                    <div class="name">时钟</div>
                    <div class="fontclass">#hd-shizhong</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-renwu"></use>
                    </svg>
                    <div class="name">人物</div>
                    <div class="fontclass">#hd-renwu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-tingchechang"></use>
                    </svg>
                    <div class="name">停车场</div>
                    <div class="fontclass">#hd-tingchechang</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-jiesongfuwu"></use>
                    </svg>
                    <div class="name">接送服务</div>
                    <div class="fontclass">#hd-jiesongfuwu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-jiaoxingfuwu"></use>
                    </svg>
                    <div class="name">叫醒服务</div>
                    <div class="fontclass">#hd-jiaoxingfuwu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-gonggao"></use>
                    </svg>
                    <div class="name">公告</div>
                    <div class="fontclass">#hd-gonggao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-yduijia"></use>
                    </svg>
                    <div class="name">YDUI-加</div>
                    <div class="fontclass">#hd-yduijia</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-tupian"></use>
                    </svg>
                    <div class="name">图片</div>
                    <div class="fontclass">#hd-tupian</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-canting"></use>
                    </svg>
                    <div class="name">餐厅</div>
                    <div class="fontclass">#hd-canting</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-shangwuzhongxinr"></use>
                    </svg>
                    <div class="name">商务中心r</div>
                    <div class="fontclass">#hd-shangwuzhongxinr</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-shuangyinhao-zuo-"></use>
                    </svg>
                    <div class="name">双引号-左</div>
                    <div class="fontclass">#hd-shuangyinhao-zuo-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-songcanfuwu"></use>
                    </svg>
                    <div class="name">送餐服务</div>
                    <div class="fontclass">#hd-songcanfuwu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-dengpao"></use>
                    </svg>
                    <div class="name">灯泡</div>
                    <div class="fontclass">#hd-dengpao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-luxian"></use>
                    </svg>
                    <div class="name">路线</div>
                    <div class="fontclass">#hd-luxian</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-dunpai"></use>
                    </svg>
                    <div class="name">盾牌</div>
                    <div class="fontclass">#hd-dunpai</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-zan2"></use>
                    </svg>
                    <div class="name">赞</div>
                    <div class="fontclass">#hd-zan2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-xihuan"></use>
                    </svg>
                    <div class="name">喜欢2</div>
                    <div class="fontclass">#hd-xihuan</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-xiaoeye"></use>
                    </svg>
                    <div class="name"> 阅读小</div>
                    <div class="fontclass">#hd-xiaoeye</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-ditu"></use>
                    </svg>
                    <div class="name">锦囊</div>
                    <div class="fontclass">#hd-ditu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-dianhua"></use>
                    </svg>
                    <div class="name">电话</div>
                    <div class="fontclass">#hd-dianhua</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-pinglun"></use>
                    </svg>
                    <div class="name">评论</div>
                    <div class="fontclass">#hd-pinglun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-luxian-yuanquan"></use>
                    </svg>
                    <div class="name">路线-圆圈</div>
                    <div class="fontclass">#hd-luxian-yuanquan</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-huifupinglun"></use>
                    </svg>
                    <div class="name">回复评论</div>
                    <div class="fontclass">#hd-huifupinglun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#hd-chakan"></use>
                    </svg>
                    <div class="name">查看</div>
                    <div class="fontclass">#hd-chakan</div>
                </li>
            
        </ul>


        <h2 id="symbol-">symbol引用</h2>
        <hr>

        <p>这是一种全新的使用方式，应该说这才是未来的主流，也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
        这种用法其实是做了一个svg的集合，与另外两种相比具有如下特点：</p>
        <ul>
          <li>支持多色图标了，不再受单色限制。</li>
          <li>通过一些技巧，支持像字体那样，通过<code>font-size</code>,<code>color</code>来调整样式。</li>
          <li>兼容性较差，支持 ie9+,及现代浏览器。</li>
          <li>浏览器渲染svg的性能一般，还不如png。</li>
        </ul>
        <p>使用步骤如下：</p>
        <h3 id="-symbol-">第一步：引入项目下面生成的symbol代码：</h3>
        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;</span></code></pre>
        <h3 id="-css-">第二步：加入通用css代码（引入一次就行）：</h3>
        <pre><code class="lang-js hljs javascript">&lt;style type=<span class="hljs-string">"text/css"</span>&gt;
.icon {
   width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
   vertical-align: <span class="hljs-number">-0.15</span>em;
   fill: currentColor;
   overflow: hidden;
}
&lt;<span class="hljs-regexp">/style&gt;</span></code></pre>
        <h3 id="-">第三步：挑选相应图标并获取类名，应用于页面：</h3>
        <pre><code class="lang-js hljs javascript">&lt;svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;<span class="xml"><span class="hljs-tag">
  &lt;<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#hd-xxx"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">use</span>&gt;</span>
</span>&lt;<span class="hljs-regexp">/svg&gt;
        </span></code></pre>
    </div>
</body>
</html>
